<?php
$this->pageTitle = 'Manage backend users';
$this->menu = array(
    array('label' => Yii::t('app', 'View Profile'), 'url' => array('viewProfile')),
);
?>
<div class="form">
    <?php
    $form = $this->beginWidget('GxActiveForm', array(
        'id' => 'tbl-backend-user-form',
        'enableAjaxValidation' => true,
        'htmlOptions' => array('enctype' => 'multipart/form-data'),
            ));
    ?>
    <div class="alert alert-success">Your password change successfully.</div>

    <p class="note">
        <?php echo Yii::t('app', 'Fields with'); ?> <span class="required">*</span> <?php echo Yii::t('app', 'are required'); ?>.
    </p>
    <?php $modelUserProfile = ($modelUserProfile) ? $modelUserProfile : new UserProfile(); ?>

    <?php echo $form->errorSummary(array($modelUserProfile, $model)); ?>

    <div class="row">
        <div class="rowLabel"><?php echo $form->labelEx($model, 'username'); ?>
        </div>
        <div class="rowControl"><?php echo $form->textField($model, 'username', array('maxlength' => 45, 'class' => 'input-xlarge', 'readonly' => 'readonly')); ?>
            <?php echo $form->error($model, 'username'); ?>
        </div><!-- row -->
    </div>
    <div class="row" style="margin-bottom:20px;">
        <div class="rowLabel">&nbsp;
        </div>
        <div class="rowControl">
            <?php
            $this->beginWidget('zii.widgets.jui.CJuiDialog', array(
                'id' => 'mydialog',
                // additional javascript options for the dialog plugin
                'options' => array(
                    'title' => 'Change-Password',
                    'autoOpen' => false,
                ),
            ));
            $this->renderPartial('/backendUser/_changePassword', array('model' => $model));
            ?>

            <?php
            $this->endWidget('zii.widgets.jui.CJuiDialog');

            $dialog_button = '<button type="button" class="btn-primary" data-loading-text="Loading...">Change-Password</button>';
            echo CHtml::link($dialog_button, '#', array(
                'onclick' => '$("#mydialog").dialog("open"); return false;',
            ));
            ?>
        </div> </div>


    <div class="row">
        <div class="rowLabel"><?php echo $form->labelEx($model, 'email'); ?>
        </div>
        <div class="rowControl"><?php echo $form->textField($model, 'email', array('maxlength' => 255, 'class' => 'input-xlarge', 'readonly' => 'readonly')); ?>
            <?php echo $form->error($model, 'email'); ?>
        </div><!-- row -->
    </div>
    <?php
    $this->renderPartial('/userProfile/_form', array('form' => $form, 'model' => $modelUserProfile));
    ?>



    <div class="row">
        <div class="rowLabel">&nbsp;</div>
        <?php
        echo GxHtml::submitButton(Yii::t('app', 'Update Profile'), array('class' => 'btn btn btn-primary'));
        $this->endWidget();
        ?>
    </div>
</div>

<!-- form -->

<style>
    .alert-success{
        display:none;
    }
    .rowLabel{float: left;
              width: 100px;
    }
</style>